package com.android.lovingpet.adopt.host.behost.view;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.util.Log;
import android.view.View;
import android.widget.TextView;

import com.amap.api.location.AMapLocation;
import com.android.lovingpet.R;
import com.android.lovingpet.base.BaseFragment;
import com.android.lovingpet.adopt.host.behost.BeHostPresenter;
import com.android.lovingpet.adopt.host.behost.IBeHostContract;
import com.android.lovingpet.mine.setting.accountsecurity.IdCardFragment;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import butterknife.Unbinder;

/**
 * Created by ikata on 2018/4/27.
 */


public class BeHostFragment extends BaseFragment<IBeHostContract.View, BeHostPresenter> implements IBeHostContract.View ,View.OnClickListener{

    Unbinder unbinder;
    @BindView(R.id.tv_experience)
    TextView tvExperience;
    @BindView(R.id.tv_id_card)
    TextView tvRealName;
    @BindView(R.id.tv_info)
    TextView tvInfo;

    @Override
    protected int setContentView() {
        return R.layout.fragment_behost;
    }

    @Override
    protected void onCreateView(View view) {
        unbinder = ButterKnife.bind(this, view);
        setTitle(view,"申请家庭");
    }


    @OnClick({R.id.tv_info,R.id.tv_id_card,R.id.tv_experience})
    @Override
    public void onClick(View v) {
        switch (v.getId())
        {
            case R.id.tv_experience:
                getFragmentManager().beginTransaction().addToBackStack(null).replace(R.id.beHost_content,new ExperienceFragment(),"PetExp").commit();
                break;
            case R.id.tv_id_card:
                getFragmentManager().beginTransaction().addToBackStack(null).replace(R.id.beHost_content,new IdCardFragment(),"IdCard").commit();
                break;
            case R.id.tv_info:
                getFragmentManager().beginTransaction().addToBackStack(null).replace(R.id.beHost_content,new FamilyInfoFragment(),"Info").commit();
                break;
        }
    }


    @Override
    public BeHostPresenter createPresenter() {
        return new BeHostPresenter();
    }

    @Override
    public IBeHostContract.View createView() {
        return this;
    }

    @Override
    public void onDestroyView() {
        super.onDestroyView();
        unbinder.unbind();
    }

    @Override
    public void next(@Nullable Bundle bundle) {

    }
}
